package com.anpy.personal;

import lombok.Data;

/**
 * 基础返回结果
 * @patams:
 * @return:
 * @Author: zxr
 * @Date: 2020/6/9 10:57
 */
@Data
public class ExceptionBaseResponse {
    /**
     * 返回码
     */
    protected int code;
    /**
     * 返回消息
     */
    protected String msg;

    public ExceptionBaseResponse() {
        // 默认创建成功的回应
        this(CommonResponse.SUCCESS);
    }

    public ExceptionBaseResponse(IResponseException responseEnum) {
        this(responseEnum.getCode(), responseEnum.getMsg());
    }

    public ExceptionBaseResponse(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
